<!DOCTYPE html>
<html ondragstart="return false"><!--不可拖拽-->
<head>
    <meta charset="UTF-8">
    <title>旋转相册</title>
    <style>
       body {
        background:#06081B;
        perspective:5000px;
       }
       .show {
        perspective:5000px;
        -webkit-transform:rotateX(-45deg);
        -moz-transform:rotateX(-45deg);
        transform:rotateX(-45deg);
        transform-style:preserve-3d;
       }
       .box {
        position:relative;
        width:150px;
        height:250px;
        /*border:1px solid red;*/
        margin:300px auto;
        transform-style:preserve-3d;
        -webkit-animation:rotate1 10s linear infinite;
        -moz-animation:rotate1 10s linear infinite;
        animation:rotate1 10s linear infinite;
       }
       .box img {
        width:150px;
        height:250px;
        /*border:1px solid #ccc;*/
        position:absolute;
        left:0;
        top:0;
        -webkit-box-reflect:below 20px -webkit-linear-gradient(top,rgba(250,250,250,0),rgba(250,250,250,0) 30%,rgba(250,250,250,0.5));
       }
       .img1 {
        -webkit-transform:translateZ(300px);
        -moz-transform:translateZ(300px);
        transform:translateZ(300px);
       }
       .img2 {
        -webkit-transform:rotateY(36deg) translateZ(300px);
        -moz-transform:rotateY(36deg) translateZ(300px);
        transform:rotateY(36deg) translateZ(300px);
       }
       .img3 {
        -webkit-transform:rotateY(72deg) translateZ(300px);
        -moz-transform:rotateY(72deg)g) translateZ(300px);
        transform:rotateY(72deg) (300px);
       }
       .img4 {
        -webkit-transform:rotateY(108deg) translateZ(300px);
        -moz-transform:rotateY(108deg) translateZ(300px);
        transform:rotateY(108deg) translateZ(300px);
       }
       .img5 {
        -webkit-transform:rotateY(144deg) translateZ(300px);
        -moz-transform:rotateY(144deg) translateZ(300px);
        transform:rotateY(144deg) translateZ(300px);
       }
       .img6 {
        -webkit-transform:rotateY(180deg) translateZ(300px);
        -moz-transform:rotateY(180deg) translateZ(300px);
        transform:rotateY(180deg) translateZ(300px);
       }
       .img7 {
        -webkit-transform:rotateY(216deg) translateZ(300px);
        -moz-transform:rotateY(216deg) translateZ(300px);
        transform:rotateY(216deg) translateZ(300px);
       }
       .img8 {
        -webkit-transform:rotateY(252deg) translateZ(300px);
        -moz-transform:rotateY(252deg) translateZ(300px);
        transform:rotateY(252deg) translateZ(300px);
       }
       .img9 {
        -webkit-transform:rotateY(288deg) translateZ(300px);
        -moz-transform:rotateY(288deg) translateZ(300px);
        transform:rotateY(288deg) translateZ(300px);
       }
       .img10 {
        -webkit-transform:rotateY(324deg) translateZ(300px);
        -moz-transform:rotateY(324deg) translateZ(300px);
        transform:rotateY(324deg) translateZ(300px);
       }
       @-moz-keyframes rotate1 {
        0% {
        -webkit-transform:rotateY(0deg);
        -moz-transform:rotateY(0deg);
        transform:rotateY(0deg);
       }
       100% {
        -webkit-transform:rotateY(360deg);
        -moz-transform:rotateY(360deg);
        transform:rotateY(360deg);
       }
       }@-webkit-keyframes rotate1 {
        0% {
        -webkit-transform:rotateY(0deg);
        -moz-transform:rotateY(0deg);
        transform:rotateY(0deg);
       }
       100% {
        -webkit-transform:rotateY(360deg);
        -moz-transform:rotateY(360deg);
        transform:rotateY(360deg);
       }
       }

       #perspective{
            perspective: 800px;/*场景景深800,仅对3D有效*/
        }

        #wrap{
            width: 133px;
            height: 200px;
            margin: 200px auto;
            position: relative;
            transform-style:preserve-3d;/*设置3d元素风格*/
            transform: rotateX(-12deg);
        }
        #wrap img{
              position: absolute;
              border: 2px solid hotpink;
              -webkit-box-reflect:below 5px -webkit-linear-gradient(top, rgba(0,0,0,0)30%, rgba(0,0,0,.5)100%);
          }
        #wrap p{
            width: 1200px;
            height: 1200px;
            border-radius: 100%;
            background: -webkit-radial-gradient(center,600px 600px,rgba(244,23,234,0.2),rgba(0,0,0,0));
            position: absolute;
            top: 112%;
            left: 50%;
            margin-left: -600px;
            margin-top: -600px;
            transform: rotateX(90deg);
        }
    </style>
</head>
<body>
<div id="perspective"></div>
<div class="show">
    <div class="box">
        <!-- <img src="img/jdek2.png" class="img1">
        <img src="img/jdek2.png" class="img2">
        <img src="img/jdek2.png" class="img3">
        <img src="img/jdek2.png" class="img4">
        <img src="img/jdek2.png" class="img5">
        <img src="img/jdek2.png" class="img6">
        <img src="img/jdek2.png" class="img7">
        <img src="img/jdek2.png" class="img8">
        <img src="img/jdek2.png" class="img9">
        <img src="img/jdek2.png" class="img10">  -->
        <img src="images/1.jpg" class="img11"> 
        <img src="images/2.jpg" class="img12"> 
        <img src="images/3.jpg" class="img13"> 
        <img src="images/4.jpg" class="img14"> 
        <img src="images/5.jpg" class="img15"> 
        <img src="images/6.jpg" class="img16"> 
        <img src="images/7.jpg" class="img17"> 
        <img src="images/8.jpg" class="img18"> 
        <img src="images/9.jpg" class="img19"> 
    </div>
</div>
<div>
    <a href="" ></a>
</div>
<script type="text/javascript">
            var oImg=document.getElementsByTagName("img");//获取元素集合
            var deg =360/oImg.length;//每两张图片间的角度
            //遍历
            window.onload=function () {
                //页面加载完执行的函数
                for(var i=0;i<oImg.length;i++){
                    oImg[i].style.transform="rotateY("+i*deg+"deg) translateZ(350px)";
                    oImg[i].style.transition="1s "+(oImg.length-i)*0.1+"s";
                }
            }
    /*鼠标移动  使相册旋转*/
    document.onmousedown = function (ev) {
        var oldX = ev.clientX;
        var  oldY = ev.clientY;//鼠标第一次点击的坐标值
        var rotateX = -15,
            rotateY=0;
        this.onmousemove = function (ev) {
            // console.log(ev.clientX,ev.clientY);
            // var newX = ev.clientX;//每次移动时产生的鼠标位置值
            // var newY = ev.clientY;
            // var minusX = newX - oldX;
            // var minusY = newY - oldY;
            // rotateX -= minusY * 0.2;
            // rotateY += minusX * 0.2;//累加改变度数差值
            // wrap.style.transform="rotateX("+rotateX+"deg)rotateY("+rotateY+"deg)";
            // oldX = newX;//新坐标值变旧坐标值
            // oldY = newY;
            // this.onmouseup=function () {
            //     this.onmousemove = null;//清空移动鼠标事件
            //     console.log("ccccc");
            // }
        }
  }
</script>
</body>
</html>

